package com.xzx.spark.core.transform

import org.apache.spark.{SparkConf, SparkContext}

/**
 *
 * ${DESCRIPTION}
 *
 * @author xinzhixuan
 * @version 1.0
 * @date 2021-06-26 8:39 下午
 */
object Spark012_SortBy {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setMaster("local[*]").setAppName("Spark010_Repartition")
    val context = new SparkContext(conf)
    val dataRDD = context.makeRDD(List(
      1, 3, 2, 1, 1, 2
    ), 2)
    dataRDD.sortBy(x => x, ascending = true).collect().foreach(println)


    context.stop()
  }
}
